<script type="text/javascript">
function toggleEmail(flag)
{
	if (flag == true)
	{
		$('#login').hide();
		$('#forgot').show();
	}
	else
	{
		$('#forgot').hide();
		$('#login').show();
	}
}  
</script>

	<h2><?php echo T_('Admin Login')?></h2>
	
	<div id="login" <?php if (($this->router->method != 'login') && ($this->router->method != 'index')) echo 'class="hide"' ?>>
		<?php echo  form_open('admins/login') ?>
		<?php if($forgot_completed):?>
			<h3>Ссылка активации нового пароля выслана Вам на почту.</h3>
	
			<p>Пожалуйста, проверьте почту. Вам выслано письмо со ссылкой активации нового пароля. После авторизации на сайте Вы можете поменять этот пароль на любой другой в своем личном профиле.<br/></p>		
		<?php endif; ?>
	
		<?php echo  form_open('admins/login', 'id="login_form"') ?>
		<table width="680" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td>
				<?php echo $login_error?>
				<br />						
				<table width="400" border="0" cellpadding="0" cellspacing="0" class="nostyle forma" style="margin:0 auto">
				<tr>
					<th width="200" align="right"><?php echo T_('Username')?></th>
					<td><div class="input_300"><?php echo form_input('user_login', '', 'id="user_login" class="input-text"') ?></div></td>
				</tr>
				<tr>
					<th align="right"><?php echo T_('Password')?></th>
					<td><div class="input_300"><?php echo  form_password('user_password', '', 'id="passwd" class="input-text"') ?></div></td>
				</tr>
				<tr>
					<td colspan="2" height="30" align="right"><a href="javascript:void(0)" onclick="toggleEmail(true)"><?php echo T_('Forgot password'); ?>?</a></td>
				</tr>
				<tr>
					<td colspan="2" align="right"><?php echo form_submit('enter', T_('btn_Login'), 'id="enter" class="input-submit"') ?></td>
				</tr>		
				</table>			
				<br />				
			</td>	
		</tr>
		</table>
		<?php echo  form_close() ?>		
	</div>

	<div id="forgot" <?php if ($this->router->method != 'password_forgot') echo 'class="hide"' ?>>
		
		<?php echo form_open('admins/password_forgot', 'id="login_form"') ?>
		<table width="680" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td>	
				<?php echo $forgot_error?>
					
				<p><?php echo T_('Please enter your login-email to get a new password.'); ?></p>
				<table width="400" border="0" cellpadding="2" cellspacing="0" class="nostyle" style="margin:0 auto">
				<tr>
					<th width="200" align="right"><?php echo T_('E-mail')?>:</th>
					<td><?php echo  form_input('forgot_user_login', $this->validation->forgot_user_login, 'class="input-text" size="50"') ?></td>
				</tr>
				<tr>
					<td colspan="2" height="30" align="right"><a href="javascript:void(0)" onclick="toggleEmail(false)" class="small10"><?php T_('Cancel'); ?></a></td>
				</tr>
				<tr>
					<td colspan="2" align="right"><?php echo  form_submit('reset_password', T_('Send me a new password'), 'id="enter" class="input-submit"') ?>
					<input type="button" class="input-submit" value="<?php echo T_('Cancel'); ?>" id="cancel_reset_password" onclick="toggleEmail(false)" /></td>
				</tr>
				</table>	
				<br />				
			</td>	
		</tr>
		</table>
		<?php echo  form_close() ?>
	</div>	